package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.CheckingAccount;
import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.domain.bank.SavingAccount;

public class ClientFactory {
    public static Client createClient(int deposit, int overdraft, Client.Gender gender, String name) {
        if (overdraft != 0) {
            return new Client(new CheckingAccount(deposit, overdraft), gender, name);
        } else {
            return new Client(new SavingAccount(deposit), gender, name);
        }
    }
}
